package com.wyg.blog.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wyg.blog.model.blog.Message;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface MessageMapper {
    IPage<Message> getSomeMessages(Page<?> page);

    IPage<Message> getSomeParentMessage(Page<?> page);

    List<Message> getMessagesByPId(Integer parent_id);

    Message getMessageById(Integer id);

    String getContentById(Integer id);

    boolean addMessage(Message message);

    boolean updateMessageState(@Param("id") Integer id, @Param("state") boolean state);

    boolean updateMessage(@Param("id") Integer id, @Param("content") String content);

    boolean deleteMessage(Integer id);

    String getEmailById(Integer id);

    boolean getStateById(Integer id);
}
